package com.tenebrous.jestic.entity.framwork.meber.organ;

import com.tenebrous.jestic.entity.TreeSerializable;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

@Getter
@Setter
@Table(name = "ORG_ORGANIZE")
public class OrgOrganize extends TreeSerializable implements Cloneable {

    private static final long serialVersionUID = -1450339698390393194L;

    private String companyid;

    private String code;

    private String name;

    private String fullname;

    private String managetag;

    private Integer islegal;

    private String legalcode;

    private String ograde;//部门分类编码

    private String ogradename;//部门分类名称

    private String onature;

    private String regionCode;

    private String regionName;

    private String industry;

    private String estabunit;

    private String estabdate;

    private String estabno;

    private String address;

    private String introduce;

    private Integer delimit;

    private String culture;

    private String duty;

    private String leaderid;

    private String phone;

    private String fax;

    private String otype;

    private Integer olevel;

    private Integer numel;

    private String remark;

    private Long sort;

    private Date createDate;

    private String createUserid;

    private Date updateDate;

    private String updateUserid;

    /******************************扩展属性*****************************/

    @Transient
    private String pname;

    @Transient
    private String leadername;

    @Transient
    private String companyname;
    /**
     * 在职正式编制的员工数
     */
    @Transient
    private Integer regularcnt;

    public String getContent() {
        return String.format("<div class='%s_%d'><div class='%s_%d_content'>%s</div></div>", otype, olevel, otype, olevel, this.getName());
    }

    @Override
    public Object clone() {
        OrgOrganize oo = null;
        try{
            oo = (OrgOrganize)super.clone();
        }catch(CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return oo;
    }
}